package com.itec.learn.mongodb.repository;

import com.itec.learn.mongodb.entity.User;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

/**
 * Author: Yiqun Chen
 * Date:   2017/9/20
 */
@RepositoryRestResource(collectionResourceRel = "users", path = "users")
public interface UserRepository extends MongoRepository<User, Long> {

    User findByUsername(@Param("username") String username);

}
